/**
 * Copyright (C) 2010 David Simonek <dafesimonek@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * SongsTableTitledPanel.java
 *
 * Created on Jun 1, 2010, 12:19:27 PM
 */

package org.dafe.partyband.gui.songs;

import java.awt.BorderLayout;
import java.awt.event.KeyEvent;
import org.dafe.partyband.gui.Utilities;
import org.jdesktop.swingx.JXCollapsiblePane.Direction;
import org.openide.util.NbBundle;

/**
 *
 * @author dafe
 */
public class SongsTableTitledPanel extends javax.swing.JPanel {
    private final SongsTable songsTable;

    /** Creates new form SongsTableTitledPanel */
    public SongsTableTitledPanel() {
        initComponents();

        songsTable = new SongsTable();
        titlePanel.setContentContainer(songsTable);

        actionsPane.setDirection(Direction.RIGHT);
        titlePanel.setRightDecoration(Utilities.createCollapsibleHandler(
                KeyEvent.VK_RIGHT,
                NbBundle.getMessage(SongsTableTitledPanel.class, "HINT_ShowHideSongsActions"),
                actionsPane));

        actionsPane.getContentPane().add(songsTable.getSongsActionsPanel(), BorderLayout.EAST);
        actionsPane.setCollapsed(false);
    }

    public SongsTable getSongsTable () {
        return songsTable;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        titlePanel = new org.jdesktop.swingx.JXTitledPanel();
        actionsPane = new org.jdesktop.swingx.JXCollapsiblePane();

        setLayout(new java.awt.BorderLayout());

        titlePanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        titlePanel.setTitle(org.openide.util.NbBundle.getMessage(SongsTableTitledPanel.class, "SongsTableTitledPanel.titlePanel.title")); // NOI18N
        add(titlePanel, java.awt.BorderLayout.CENTER);
        add(actionsPane, java.awt.BorderLayout.LINE_END);
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private org.jdesktop.swingx.JXCollapsiblePane actionsPane;
    private org.jdesktop.swingx.JXTitledPanel titlePanel;
    // End of variables declaration//GEN-END:variables

}
